package com.xyxeshang.es.music.backend.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xyx-Eshang
 */
@SuppressWarnings("all")
public class ResultConstant {
	public static Map<Integer, String> messageMap = new HashMap<>();

	//===常规===
	public static int SUCCESS = 10000;
	public static int FAILED = 20000;
	public static int ERROR = 40000;
	public static int PARAMETER_IS_NULL = 40001;
	public static int PARAMETER_IS_WRONG = 40002;

	static {
		messageMap.put(SUCCESS, "成功");
		messageMap.put(FAILED, "失败");
		messageMap.put(ERROR, "系统异常");
		messageMap.put(PARAMETER_IS_NULL, "传入的参数值为空");
		messageMap.put(PARAMETER_IS_WRONG, "参数有误");
	}

	//===注册登录===
	public static int CONFIRM_PASSWORD_IS_WRONG = 20101;
	public static int USER_NAME_IS_EXIST = 20102;
	public static int LOGIN_FAILED = 20103;
	public static int YOU_ARE_NORMAL_USER = 10101;
	public static int YOU_ARE_ADMIN_USER = 10102;

	static {
		messageMap.put(CONFIRM_PASSWORD_IS_WRONG, "两次输入的密码不一致");
		messageMap.put(USER_NAME_IS_EXIST, "用户名已被使用");
		messageMap.put(LOGIN_FAILED, "登录失败");
		messageMap.put(YOU_ARE_NORMAL_USER, "登录成功，您是普通用户");
		messageMap.put(YOU_ARE_ADMIN_USER, "登录成功，您是管理员");
	}

	//===jwt===
	public static int TOKEN_IS_NULL = 20201;
	public static int TOKEN_HAS_EXPIRED = 20202;
	public static int TOKEN_IS_FAKE = 20203;

	static {
		messageMap.put(TOKEN_IS_NULL, "令牌为空");
		messageMap.put(TOKEN_HAS_EXPIRED, "令牌已过期");
		messageMap.put(TOKEN_IS_FAKE, "令牌是伪造的");
	}

}
